package pers.liyan.shi.springboot.mapper;

import org.apache.ibatis.annotations.*;
import pers.liyan.shi.springboot.bean.Department;

public interface DepartmentMapper {

    @Select("select * from department where id = #{id}")
    public Department getDeptById(Integer id);

    @Update("update department set departmentName=#{departmentName} where id = #{id}")
    public int updateDept(Department department);

    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into department (departmentName) values (#{departmentName})")
    public int insertDept(Department department);

    @Delete("delete from department where id = #{id}")
    public int deleteDeptById(Integer id);

}
